﻿Public Class TestRegularExpressions

    Public Shared Sub Main()
        Dim sentences As String() = {"cow over the moon", "Betsy the Cow", "cowering in the corner", "no match here"}

        Dim sPattern As String = "cow"

        For Each s As String In sentences
            System.Console.Write("{0,24}", s)

            If System.Text.RegularExpressions.Regex.IsMatch(s, sPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase) Then
                System.Console.WriteLine("  (match for '{0}' found)", sPattern)
            Else
                System.Console.WriteLine()
            End If
        Next
    End Sub
End Class
